<?php
declare (strict_types = 1);
/**
 * +----------------------------------------------------------------------
 * | 管理员日志控制器
 * +----------------------------------------------------------------------
 */
namespace app\controller\sys;

// 引入框架内置类
use think\facade\View;

use app\model\SysLog as SysLogModel;
use app\utils\ReUtils;

class SysLog extends Base
{
    public function index($limit = 30)
    {
        $list = SysLogModel::queryPage($limit, 0);

        View::assign('list', $list);

        return View::fetch();
    }

    public function delete($id)
    {
        if ($this->app->request->isPost()) {
            if (SysLogModel::destroy($id)) {
                return ReUtils::success();
            } else {
                return ReUtils::error();
            }
        }
    }
}
